home *** CD-ROM | disk | FTP | other *** search
/ Chip 2007 January, February, March & April / Chip-Cover-CD-2007-02.iso / Pakiet bezpieczenstwa / mini Pentoo LiveCD 2006.1 / mpentoo-2006.1.iso / livecd.squashfs / usr / lib / mozilla-firefox / idl / nsIXmlRpcClient.idl < prev    next >
Text File  |  2006-05-08  |  7KB  |  189 lines

  1. /* ***** BEGIN LICENSE BLOCK *****
  2.  * Version: MPL 1.1/GPL 2.0/LGPL 2.1
  3.  *
  4.  * The contents of this file are subject to the Mozilla Public License Version
  5.  * 1.1 (the "License"); you may not use this file except in compliance with
  6.  * the License. You may obtain a copy of the License at
  7.  * http://www.mozilla.org/MPL/
  8.  *
  9.  * Software distributed under the License is distributed on an "AS IS" basis,
  10.  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
  11.  * for the specific language governing rights and limitations under the
  12.  * License.
  13.  *
  14.  * The Original Code is Mozilla XML-RPC Client component.
  15.  *
  16.  * The Initial Developer of the Original Code is
  17.  * Digital Creations 2, Inc.
  18.  * Portions created by the Initial Developer are Copyright (C) 2000
  19.  * the Initial Developer. All Rights Reserved.
  20.  *
  21.  * Contributor(s):
  22.  *   Martijn Pieters <mj@digicool.com> (original author)
  23.  *
  24.  * Alternatively, the contents of this file may be used under the terms of
  25.  * either the GNU General Public License Version 2 or later (the "GPL"), or
  26.  * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
  27.  * in which case the provisions of the GPL or the LGPL are applicable instead
  28.  * of those above. If you wish to allow use of your version of this file only
  29.  * under the terms of either the GPL or the LGPL, and not to allow others to
  30.  * use your version of this file under the terms of the MPL, indicate your
  31.  * decision by deleting the provisions above and replace them with the notice
  32.  * and other provisions required by the GPL or the LGPL. If you do not delete
  33.  * the provisions above, a recipient may use your version of this file under
  34.  * the terms of any one of the MPL, the GPL or the LGPL.
  35.  *
  36.  * ***** END LICENSE BLOCK ***** */
  37.  
  38. /*
  39.  *  XPCOM XML-RPC Client, interface definition.
  40.  *  Version: $Revision: 1.6 $
  41.  *
  42.  *  $Id: nsIXmlRpcClient.idl,v 1.6 2004/04/18 22:14:12 gerv%gerv.net Exp $
  43.  */
  44.  
  45. #include "nsISupports.idl"
  46. #include "nsIURL.idl"
  47. #include "nsIXmlRpcClientListener.idl"
  48.  
  49. // forward decl.
  50. interface nsIXmlRpcFault;
  51.  
  52. /**
  53.  * Simple XML-RPC client interface.
  54.  */
  55. [scriptable, uuid(37127241-1e6e-46aa-ba87-601d41bb47df)]
  56. interface nsIXmlRpcClient: nsISupports {
  57.     /**
  58.      * Set server URL. Call this before using this object.
  59.      *
  60.      * @param serverURL URL of server side object on which methods should
  61.      *                  be called.
  62.      */
  63.     void init(in string serverURL);
  64.  
  65.     /**
  66.      * Set authentication info if needed.  Both parameters must be
  67.      * specified for authentication to be enabled.
  68.      *
  69.      * @param username  username to be used if asked to authenticate
  70.      * @param password  password to be used if asked to authenticate
  71.      */
  72.     void setAuthentication(in string username, in string password);
  73.  
  74.     /**
  75.      * Clear authentication info.
  76.      */
  77.     void clearAuthentication(in string username, in string password);
  78.  
  79.     /**
  80.      * The URL of the XML-RPC server
  81.      */
  82.     readonly attribute nsIURL serverURL;
  83.  
  84.     /**
  85.      * Call remote method methodName asynchronously with given arguments.
  86.      * 
  87.      * Supported arguments are:
  88.      * nsISupportsPRUint8, nsISupportsPRUint16,
  89.      * nsISupportsPRInt16, nsISupportsPRInt32: <i4>
  90.      * nsISupportsPRBool: <boolean>
  91.      * nsISupportsChar, nsISupportsCString: <string>
  92.      * nsISupportsFloat, nsISupportsDouble: <double>
  93.      * nsISupportsPRTime: <dateTime.iso8601>
  94.      * nsIInputStream: <base64>
  95.      * nsISupportsArray: <array>
  96.      * nsIDictionary: <struct>
  97.      *
  98.      * Note that both nsISupportsArray and nsIDictionary can only hold any of
  99.      * the supported input types.
  100.      *
  101.      * Return value will be converted as follows:
  102.      * <i4> or <int>: nsISupportsPRInt32
  103.      * <boolean>: nsISupportsPRBool
  104.      * <string>: nsISupportsCString
  105.      * <double>: nsISupportsDouble
  106.      * <dateTime.iso8601>: nsISupportsPRTime
  107.      * <base64>: nsISupportsCString
  108.      * <array>: nsISupportsArray
  109.      * <struct>: nsIDictionary
  110.      *
  111.      * <fault>s (server side errors) are indicated by returning
  112.      * NS_ERROR_FAILURE. Via nsIXPConnect::GetPendingException()->data a
  113.      * nsIXmlRpcFault object can be retreieved with more information on the
  114.      * fault.
  115.      *
  116.      * @param listener          A nsIXmlRpcClientListener that will get notified
  117.      *                          of XML-RPC events.
  118.      * @param context           A context to be passed on to the listener.
  119.      * @param methodName        Remote method to call.
  120.      * @param arguments         Array of arguments to pass to remote method.
  121.      * @return                  Return value of remote method.
  122.      */
  123.     void asyncCall(in nsIXmlRpcClientListener listener, in nsISupports ctxt,
  124.         in string methodName,
  125.         [array, size_is(count)] in nsISupports arguments, in PRUint32 count);
  126.  
  127.     /**
  128.      * Wether or not a call is in progress
  129.      */
  130.     readonly attribute boolean inProgress;
  131.     
  132.     /**
  133.      * The most recent XML-RPC fault from returned from this server.
  134.      * null if the last call didn't return an XML-RPC fault.
  135.      */
  136.     readonly attribute nsIXmlRpcFault fault;
  137.  
  138.     /**
  139.      * The most recent XML-RPC call result returned from this server.
  140.      * null if the last call didn't return a valid result
  141.      */
  142.     readonly attribute nsISupports result;
  143.  
  144.     /**
  145.      * The most recent HTTP status code returned from this server
  146.      * null if the server was unreachable or not yet contacted.
  147.      */
  148.     readonly attribute unsigned long responseStatus;
  149.     readonly attribute unsigned long responseString;
  150.  
  151.     /**
  152.      * Convenience: return the correct nsISupportsPrimitive for a given XML-RPC
  153.      * type, or nsISupportsArray or nsIDictionary.  'base64' isn't supported.
  154.      * No QueryInterface call is needed, the object has been QueryInterfaced to
  155.      * the correct interface.
  156.      *
  157.      * @param type              One of the listed constants.
  158.      * @param uuid              The uuid of the returned object. No QI call 
  159.      *                          needed.
  160.      * @param nsQIResult        The apropriate XPCOM object.
  161.      */
  162.     void createType(in unsigned long type, out nsIIDRef uuid, 
  163.         [iid_is(uuid),retval] out nsQIResult result);
  164.     const unsigned long INT      = 1; // nsISupportsPRInt32
  165.     const unsigned long BOOLEAN  = 2; // nsISupportsPRBool
  166.     const unsigned long STRING   = 3; // nsISupportsCString
  167.     const unsigned long DOUBLE   = 4; // nsISupportsDouble
  168.     const unsigned long DATETIME = 5; // nsISupportsPRTime
  169.     const unsigned long ARRAY    = 6; // nsISupportsArray
  170.     const unsigned long STRUCT   = 7; // nsIDictionary
  171. };
  172.  
  173. /**
  174.  * An XML-RPC exception.
  175.  * XML-RPC server fault codes are returned wrapped in this Access via
  176.  * nsIXPConnect::GetPendingException()->data
  177.  */
  178. [scriptable, uuid(691cb864-0a7e-448c-98ee-4a7f359cf145)]
  179. interface nsIXmlRpcFault: nsISupports {
  180.     readonly attribute PRInt32 faultCode;
  181.     readonly attribute string faultString;
  182.     
  183.     void init(in PRInt32 faultCode, in string faultString);
  184.  
  185.     string toString();
  186. };
  187.  
  188. // vim:sw=4:sr:sta:et:sts:
  189.